You are here: Symbol Reference > Dew Namespace > Dew.Math Namespace > Classes > VectorInt Structure > VectorInt Methods > Reverse Method > VectorInt.Reverse Method ([In] TMtxVecInt, [In] int, [In] int, [In] int)
Dew Math for .NET
ContentsIndexHome
PreviousUpNext
VectorInt.Reverse Method ([In] TMtxVecInt, [In] int, [In] int, [In] int)

Reverse vector elements.

Syntax
C#
Visual Basic
public TMtxVecInt Reverse([In] TMtxVecInt Vec, [In] int VecIndex, [In] int Index, [In] int Len);

The method reverses Vec vector elements from [VecIndex].. [VecIndex+Len-1] and stores them in the calling vector from [Index]...[Index+Len-1] by using the following equation: 

 

 

 

This overload reverses calling vector elements in-place.

using Dew.Math; using Dew.Math.Units; namespace Dew.Examples() { void Example() { TVecInt a; MtxVecInt.CreateIt(out a); try { a.SetIt(new int[] {1,2,3,4); a.Reverse(); // a = [4,3,2,1] } finally { MtxVecInt.FreeIt(ref a); } } }
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!